package Coffee.controller;

import Coffee.bean.Coffee;
import Coffee.dao.CoffeeDao;
import Coffee.dao.CoffeeDaoImpl;
import Coffee.service.CoffeeService;
import Coffee.service.CoffeeServiceImpl;

import java.util.List;
import java.util.UUID;

public class test {
    public static void main(String[] args) {
        CoffeeDao coffeeDao = new CoffeeDaoImpl();
        CoffeeService coffeeService = new CoffeeServiceImpl();
        //////添加////////////////////////
     // Coffee cof = new Coffee();
     // cof.setCofid(UUID.randomUUID().toString().replaceAll("-", ""));
     // cof.setCofname("白兰地");
     // cof.setCofprice(121);
     // cof.setState("在售");
     // coffeeService.insertCoffee(cof);
        //////////////////////////////////
        //////////按名字查询coffee
       // System.out.println(coffeeService.selectbyname("日落"));
        //////////////////////////
        //按名字删除
        //System.out.println(coffeeService.delbyname("日落"));
        ////////////////////////////////
        //修改
       //int i = coffeeDao.updateCofbyname("拿铁",20,"售完");
       //System.out.println(i);
        //查询所有
        List<Coffee> coffees = coffeeService.selectAll();
        coffees.iterator().forEachRemaining(System.out::println);
        System.out.println(coffeeService.selectlikaname("铁"));


    }
}
